<?php
/**
 * Template Name: 4 Col. Portfolio
 * Description: A 4 Column Shadowbox portfolio
 *
 */
define('SHADOWBOX', true);
wp_enqueue_script('isotope');
wp_enqueue_style('isotope');
get_header();
?>
<!-- page-portfolio-4.php -->
<div id="portfolio" class="sixteen columns">
	<?php
	the_post();
	get_template_part('content', 'page');
	?>
</div> <!-- end #portfolio -->

<?php
// get the children
$args = array(
	'post_type'		=> 'page',
	'post_parent' 	=> get_the_ID(),
	'posts_per_page'=> -1,
	'orderby'		=> 'menu_order'
);

$children = new WP_Query($args);

if ($children->have_posts()) :
while ($children->have_posts()) :

$children->the_post();
$title = get_the_title();
$image = get_the_post_thumbnail(get_the_ID(), 'one-third');
$large_image_url = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'large');
?>
<div class="one-third column">
	<div class="gallery-image">
		<a href="<?php echo $large_image_url[0]; ?>" class="shadowbox">
			<?php echo $image; ?>
		</a>
	</div>
</div> 
<?php
endwhile;
?> 
<script type="text/javascript">
Shadowbox.init(
	{
		skipSetup : true
	}
);

Shadowbox.setup(
	"a.shadowbox", 
	{
		'gallery' : 'Images',
		// 'width' : 640,
		// 'height' : 480,
		'continuous' : true
	}
);
</script>
<?php
endif;
get_footer();
?>